import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        name: 'login',
        path: '/login',
        component: () => import('@/views/login/index.vue')
    },
    {
        name: 'index',
        path: '/',
        component: () => import('@/views/index/index.vue')
    },
    {
        name: 'project',
        path: '/project',
        component: () => import('@/views/project/index.vue'),
        // redirect: '/project/api/index',
        children: [
            {
                name: 'api',
                path: 'api',
                component: () => import('@/views/project/children/api/index.vue'),
                children: [
                    // {
                    //     path: 'index',
                    //     name: 'api-index',
                    //     component: () => import('@/views/project/children/api/children/index/index.vue')
                    // },
                    // {
                    //     path: 'list',
                    //     name: 'api-list',
                    //     component: () => import('@/views/project/children/api/children/list/index.vue')
                    // },
                    // {
                    //     path: 'detail',
                    //     name: 'api-detail',
                    //     component: () => import('@/views/project/children/api/children/detail/index.vue'),
                    //     redirect: '/project/api/detail/prev',
                    //     children: [
                    //         {
                    //             name: 'api-detail-prev',
                    //             path: 'prev',
                    //             component: () => import('@/views/project/children/api/children/detail/children/prev/index.vue'),
                    //         },
                    //         {
                    //             name: 'api-detail-edit',
                    //             path: 'edit',
                    //             component: () => import('@/views/project/children/api/children/detail/children/edit/index.vue'),
                    //         },
                    //         {
                    //             name: 'api-detail-run',
                    //             path: 'run',
                    //             component: () => import('@/views/project/children/api/children/detail/children/run/index.vue'),
                    //         }
                    //     ]
                    // },
                    // {
                    //     path: 'quick',
                    //     name: 'api-quick',
                    //     component: () => import('@/views/project/children/api/children/quick/index.vue')
                    // },
                ]
            },
            {
                name: 'setup',
                path: 'setup',
                component: () => import('@/views/project/children/setup/index.vue'),
                children: [
                    {
                        path: 'common',
                        name: 'setup-common',
                        component: () => import('@/views/project/children/setup/children/common/index.vue')
                    },
                    {
                        path: 'env',
                        name: 'setup-env',
                        component: () => import('@/views/project/children/setup/children/env/index.vue')
                    },
                ]
            }
        ]
    },
    {
        name: 'todo',
        path: '/todo',
        component: () => import('@/views/todo/index.vue')
    },
    {
        name: 'redmine',
        path: '/redmine',
        component: () => import('@/views/redmine/index.vue')

    }
]

const router = new VueRouter({
    routes,
})

export default router